package com.banshou.installs.model.net;

import com.banshou.installs.constant.BaseApplication;
import com.banshou.installs.utils.SharePreUtil;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by cjq on 2018/7/31.
 * Email: stoic_yb@139.com
 * features:
 */
public class RetrofitManager2 {
    private static Map<Boolean, RetrofitClient> clientMap = new HashMap<>();

    private RetrofitManager2() {
    }

    public static RetrofitClient getInstance() {
        String token = SharePreUtil.getToken(BaseApplication.getContext(), "NULL");
        RetrofitClient client;

        client = clientMap.get(token.equals("NULL"));
        if (client == null) {
            client = new RetrofitClient(token.equals("NULL"));
            clientMap.put(token.equals("NULL"), client);
        }

        return client;
    }

}
